
import java.util.List;
import java.util.logging.Logger;

public abstract class FishingDataSource {

    protected static final Logger log = Logger.getLogger("Minecraft");
    protected List<Tier> tiers;
    protected List<Fish> fishes;
    protected List<Bucket> buckets;
    protected int fishChance;
    protected final Object tierLock = new Object();
    protected final Object fishLock = new Object();
    protected final Object chanceLock = new Object();
    protected final Object bucketLock = new Object();

    abstract public void initialize();

    abstract public void loadFish();
    abstract public void loadBucket();

    abstract public void addBucket(Bucket bucket);
    abstract public void removeBucket(Bucket bucket);

    public synchronized int getFishChance() {
            return fishChance;
    }

    public synchronized List<Tier> getTier() {
            return tiers;
    }

    public synchronized List<Bucket> getBucketList() {
        return buckets;
    }

    public synchronized Bucket getBucket(String name, int item) {
        for (Bucket bk : buckets) {
            if (bk.name.equals(name) && bk.itemNum == item) {
                return bk;
            }
        }
        return null;
    }

    public synchronized List<Fish> getFish() {
            return fishes;
    }
}
